package com.itqf.exception;

import com.itqf.utils.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import javax.naming.AuthenticationException;

/**
 * @author 徐老板
 * @date 2020/2/2   16:51
 */
@RestControllerAdvice
public class ExceptionConfig {

    @ExceptionHandler(AuthenticationException.class)
    public R exceptionHandler(AuthenticationException e){
        return R.error(e.getMessage());
    }


    @ExceptionHandler(MyException.class)
    public R exceptionHandler(MyException e){
        return R.error(e.getMessage());
    }


    @ExceptionHandler(Exception.class)
    public R exceptionHandler(Exception e){
        return R.error(e.getMessage());
    }
}
